package com.foundjet.ymorder.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.foundjet.back.order.model.Order;
import com.foundjet.ymorder.service.OrderService;


@RequestMapping("/list")
@Controller
public class ListController {
	@Autowired
	OrderService orderSvc;
	
	@RequestMapping("/all")
	@ResponseBody
	public String all(int userid) {
		List<Order> orderList = orderSvc.getAllOrder(userid);
		JSONArray array = new JSONArray();
		array.addAll(orderList);
		return array.toJSONString();
	}
}
